<?php
use think\facade\Route;
Route::group('user', function () {
    // 注册接口（应用register验证场景）
    Route::post('register', 'user/register')
        ->middleware(\app\middleware\ValidateParams::class, 'user.register');

    // 登录接口（应用login验证场景）
    Route::post('login', 'user/login')
        ->middleware(\app\middleware\ValidateParams::class, 'user.login');

    // 需要身份验证的接口
    Route::group(function () {
        Route::put('profile', 'user/updateProfile');
    })->middleware(\app\middleware\JwtAuth::class);
    
})->allowCrossDomain();

